from espnet_onnx.export import ASRModelExport

def convert_espnet_onnx(model_zip=None, tag_name=None):
    model_zip = "asr_train_asr_conformer3_raw_char_batch_bins4000000_accum_grad4_sp_valid.acc.ave.zip"
    model_zip = "/public/ai_platform/models/cmcc_2022/conformer_espnet/asr_train_asr_conformer3_raw_char_batch_bins4000000_accum_grad4_sp_valid.acc.ave.zip"
    model_zip = "/gyf/pkg/conformer_new/asr_train_asr_conformer3_raw_char_batch_bins4000000_accum_grad4_sp_valid.acc.ave.zip"
    
    tag_name = "/gyf/pkg/conformer_new/"
    
    onnx_export = ASRModelExport("/gyf/pkg/conformer_new/")
    onnx_export.set_export_config(max_seq_len=2048)
    onnx_export.export_from_zip(model_zip, tag_name=tag_name, quantize=False)
    
convert_espnet_onnx()
